/**
 * 应用使用的常量
 */
export class AppConsts {
  /**
   * 远程服务器地址
   */
  public static remoteServiceBaseUrl: string;

  /**
   * 门户地址
   */
  public static portalBaseUrl: string;

  /**
   * 当前应用地址
   */
  public static appBaseUrl: string;

  /**
   * 上传文件api路径
   */
  public static uploadApiUrl = '/api/File/Upload';

  /**
   * 个人头像上传最大MB
   */
  public static maxProfilPictureMb = 1;

  /** 多租户请求头名称 */
  public static tenantIdCookieName = 'Tenant';

  /**
   * 后端本地化和前端angular本地化映射
   */
  public static localeMappings: any;

  /**
   * 后端本地化和ng-zorro本地化映射
   */
  public static ngZorroLocaleMappings: any;

  /**
   * 后端本地化和ng-alian本地化映射
   */
  public static ngAlainLocaleMappings: any;

  /**
   * 后端本地化和moment.js本地化映射
   */
  public static momentLocaleMappings: any;

  public static readonly userManagement = {
    defaultAdminUserName: 'admin',
  };

  static readonly superUserManagement = {
    defaultAdminUserName: 'SuperAdmin',
  };

  public static readonly localization = {
    defaultLocalizationSourceName: 'FoundationTemplate',
  };

  public static readonly authorization = {
    encrptedAuthTokenName: 'enc_auth_token',

    // token过期时间
    authTokenExpireDateTime: 'auth_token_expire_date_time',

    // token过期时间提示间隔 提前5分钟提示
    promptInterval: '5',
  };

  /**
   * 数据表格设置
   */
  // tslint:disable-next-line:member-ordering
  public static readonly grid = {
    /**
     * 每页显示条目数
     */
    defaultPageSize: 10,
    /**
     * 每页显示条目数下拉框值
     */
    defaultPageSizes: ['10', '20', '30', '40'],
  };

  /**
   * 导出设置
   */
  public static readonly export = {
    /**
     * 分页接口最大导出量
     */
    maxResultCount: 999,
    skipCount: 0,
  };
  /**
   * top bar通知组件中获取通知数量
   */
  public static readonly notificationCount = 5;
  public static readonly button = {
    create: 'Create',
    copy: 'Copy',
    createVersion: 'CreateVersion',
    copyVersion: 'CopyVersion',
    edit: 'Edit',
    delete: 'Delete',
    deleteVersion: 'DeleteVersion',
    submit: 'Submit',
    save: 'Save',
    refresh: 'Refresh',
    cancel: 'Cancel',
    import: 'Import',
    modelAudit: 'Audit',
  };
  static readonly message = {
    createSuccess: 'SuccessfullyCreated',
    createFailed: 'CreatedFailed',
    copySuccess: 'SuccessfullyCopyd',
    copyFailed: 'CopydFailed',
    deleteSuccess: 'SuccessfullyDeleted',
    saveSuccess: 'SavedSuccessfully',
    auditSuccess: 'AuditSuccessfully',
    forbidSuccess: 'SuccessfullyForbid',
    deleteWarn: 'Message.DeleteWarning',
    pleaseSelectRow: 'PleaseSelectRow',
    submitSuccess: 'SuccessfullySubmit',
    modifySuccess: 'SuccessfullyModified',
    pleaseSelectAtLeastOneRow: 'Message.Common.PleaseSelectAtLeastOneRow',
    pasteSuccessfully: 'SuccessfullyPaste',
    copySuccessfully: 'SuccessfullyCopy',
    activeSuccess: 'Message.Common.ActiveSuccess',
    refreshSuccess: 'RefreshSuccess',
    uploadedFile: 'UploadedFile',
    uploadError: 'UploadError',
    unsupportedFileType: 'UnsupportedFileType',
    rdoRefreshSuccess: 'RdoRefreshSuccess',
    rdoCreateSuccess: 'RdoCreateSuccess',
    rdoUpdateSuccess: 'RdoUpdateSuccess',
    rdoDeleteSuccess: 'RdoDeleteSuccess',
    rdoCopySuccess: 'RdoCopySuccess',
    rdoCopyRevSuccess: 'RdoCopyRevSuccess',
  };
  /** 配置key */
  static readonly settings = {
    /** 布局 */
    ThemeLayout: 'App.Shared.Theme.Layout',
    /** 互斥 */
    LoginMutex: 'App.Shared.LoginMutex',
    /** 最大用户数 */
    MaxLoginUserNumber: 'App.MaxLoginUserNumber',
    /** 双重认证 */
    TwoFactorLogin: {
      /** google认证 */
      IsGoogleAuthenticatorEnabled: 'App.Shared.TwoFactorLogin.IsGoogleAuthenticatorEnabled',
    },
    /** 门户 url */
    ProtalUrl: 'App.Shared.ProtalUrl',
    /** 管理 url */
    AdminApiUrl: 'App.Shared.AdminApiUrl',
    /** 管理界面 url */
    AdminUiUrl: 'App.Shared.AdminUiUrl',
    /** 用户中心 url */
    UserCenterUrl: 'App.Shared.UserCenterUrl',
    /** 门户 url */
    HostSettings: {
      /** 允许租户注册 */
      AllowSelfOnTenantRegistration: 'App.HostManagement.AllowSelfOnTenantRegistration',
      /** 租户注册时候启动验证码 */
      UseCaptchaOnTenantRegistration: 'App.HostManagement.UseCaptchaOnTenantRegistration',
      /** 演示模式 */
      PreviewMode: 'App.HostManagement.PreviewMode',
    },
    SharedSettings: {
      /** 启用用户登陆验证码 */
      UseCaptchaOnUserLogin: 'App.Shared.UseCaptchaOnUserLogin',
      /** 允许用户注册 */
      AllowSelfRegistrationUser: 'App.Shared.AllowSelfRegistrationUser',
      /** 启用用户注册验证码 */
      UseCaptchaOnUserRegistration: 'App.Shared.UseCaptchaOnUserRegistration',
      /** 启用忘记密码验证码 */
      UseCaptchaOnUserForgotPassword: 'App.Shared.UseCaptchaOnUserForgotPassword',
    },
  };
  /** 配置常量 */
  static readonly settingValues = {
    theme: {
      layout: {
        default: 'Default',
        top_navigation_menu: 'TopNavigationMenu',
      },
    },
  };
}
